package com.graduation.rescuematerial.controller;

import com.graduation.rescuematerial.service.CompanyService;
import com.graduation.rescuematerial.vo.RespBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:CaiShuangLian
 * @FileName:
 * @Date:Created in  2022/4/21 23:40
 * @Version:
 * @Description:TODO
 */
@RestController
@Api(tags = "普通用户模块(包含了所有普通用户可以查看的信息)")
@RequestMapping("/common")
public class CommonController {

    @Autowired
    private CompanyService companyService;

    @ApiOperation("获取type是department的组织信息")
    @ResponseBody
    @GetMapping("/department")
    public RespBean getAllDepartment(){
        return RespBean.success(companyService.getAllCompany("department"));
    }

    @ApiOperation("获取type是warehouse的组织信息")
    @ResponseBody
    @GetMapping("/warehouse")
    public RespBean getAllWarehouse(){
        return RespBean.success(companyService.getAllCompany("warehouse"));
    }

}
